feat: add MotherDuck cloud DuckDB support#119
Merged
Conversation
Add a new database provider for MotherDuck, the cloud-hosted DuckDB service. This adds MotherDuck as a separate connection type with its own form fields for database name and access token. - Add MOTHERDUCK to DatabaseType enum - Create motherduck provider with adapter inheriting from DuckDBAdapter - Support md: connection strings with optional database and token - Add unit tests for connection string building and provider registration
- Make database and access token required fields - Use file-based URL parsing for motherduck:///database?token=xxx format - Update tests for new requirements
- Use standard password field (stored in keyring) instead of custom token field - Fix file-based vs tcp-based endpoint handling - Access token is now stored securely via credentials service
MotherDuck requires database.schema.table format for queries. Override build_select_query to include the database prefix.
MotherDuck supports multiple databases, so the explorer tree needs to pass the database name through to build correct queries.
- Rename database field to default_database (stored in options) - This keeps tcp_endpoint.database empty so tree shows Databases folder - Add get_databases() to list all MotherDuck databases - Add get_tables/get_views() with database filtering
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for MotherDuck, a cloud-hosted DuckDB service.
MOTHERDUCKas a new database type in the connection pickerFixes #103
Implementation
sqlit/domains/connections/providers/motherduck/- new provider packageadapter.py- extends DuckDBAdapter, overridesconnect()to buildmd:connection stringsschema.py- defines form fields (database name, access token)provider.py- registers the provider with metadataDatabaseTypeenum and display orderTest plan